Tree Macros

Emma Pease

The tree macros package allows one to integrate TEX and Postscript. For example, one can use TEX to layout a tree and have Postscript draw the lines.

  abtop node  
acleft node   cright node
    dodd node
abac abc cd [r]ab[r]d1in [b]ac[l]d [l]ab[l]ac1in

These macros work by defining locations on a page and then manipulating them in a variety of ways. The commands that created the above tree are as follows:

\begin{tabular}{ccc}
                    &\node{a}{top node}\\[3ex]
\node{b}{left node} &     & \node{c}{right node}\\[3ex]
                    &     & \node{d}{odd node}
\end{tabular}
\nodeconnect{a}{b} 
\nodeconnect{a}{c}
\nodeconnect{c}{d}
\nodecurve[r]{a}[r]{d}{1in}
\anodeconnect[b]{b}[l]{d}
\anodecurve[l]{a}[l]{b}{1in}
You will notice that four nodes are defined, a, b, c, and d, using the \node command. These nodes are then connected using the \nodeconnect and \nodecurve commands.